from mypkg import mylib

y = mylib.func1()
print(y)

try:
    y = mylib.func1(0)
except TypeError as e:
    print(e)

y = mylib.func2()
print(y)

y = mylib.func3(45)
print(y)

y = mylib.func3(x=47)
print(y)

try:
    y = mylib.func3()
except TypeError as e :
    print(e)

try:
    y = mylib.func3(y=47)
except TypeError as e :
    print(e)

y = mylib.func4(48)
print(y)

y = mylib.func4(49)
print(y)

y = mylib.func4()
print(y)

print(mylib.calculate(10, 5, operation="add"))
print(mylib.calculate(b=5, a=10, operation="add"))
print(mylib.calculate([5, 8], operation="subtract"))

try:
    print(mylib.func6(a=10, b=5))
except TypeError as e:
    print(e)

try:
    print(mylib.func7(10, 5, "subtract"))
except TypeError as e:
    print(e)

    print(mylib.func8())

def func9(**user):
    for key, value in user.items():
        print(f"{key}: {value}")

def func10(arg1, arg2, named_arg="default"):
    print(f"位置实参 arg1: {arg1}")
    print(f"位置实参 arg2: {arg2}")
    print(f"命名实参 named_arg: {named_arg}")